$(function () {

    var rowIndex = document.getElementById("curr-page").innerHTML;
    // alert(rowIndex);
    var url = "/beiying/grass/getlist?rowIndex=" ;
    $('#prev').click(function () {
        if (rowIndex > 1){
            rowIndex = rowIndex-1;
            url = url + rowIndex;
            $('#preva').attr('href',url);
        }
        else {
            alert("已经是首页");
        }
    });
    $('#next').click(function () {
        if (rowIndex < 2076){
            rowIndex = parseInt(rowIndex) + 1;
            url = url + rowIndex;
            $('#nexta').attr('href',url);
        }
        else {
            alert("已经是最后一页");
        }
    });
    $('#goTo').click(function () {
        rowIndex = $('#goToPage').val();
        if (rowIndex < 1 || rowIndex > 2076){
            alert("没有此页的内容");
        }
        url = url + rowIndex;
        $('#gotoa').attr('href',url);
    });
});